<?php
/*
 * @Author        : 易航
 * @Url           : http://guide.bri6.cn
 * @Date          : 2023-09-29 13:18:36
 * @LastEditTime  : 2024-07-21 16:11:45
 * @Email         : 2136118039@qq.com
 * @Project       : 易航网址导航系统
 * @Description   : 一款极其优雅的易航网址导航系统
 * @Read me       : 感谢您使用易航网址导航系统，系统源码有详细的注释，支持二次开发。
 * @Remind        : 使用盗版系统会存在各种未知风险。支持正版，从我做起！
*/
 namespace system\library; class NetscapeBookmarkParser { protected $keepNestedTags; protected $defaultTags; protected $defaultPub; protected $items; const TRUE_PATTERN = "\x79\174\x79\145\x73\174\157\156\x7c\x63\150\x65\143\153\145\144\x7c\x6f\153\x7c\x31\x7c\x74\x72\x75\x65\174\141\162\x72\141\x79\x7c\x5c\53\x7c\157\153\141\x79\174\x79\145\163\x7c\x74\174\x6f\156\145"; const FALSE_PATTERN = "\x6e\x7c\x6e\x6f\x7c\x6f\146\x66\174\145\x6d\160\x74\171\x7c\x6e\x75\154\154\x7c\146\141\x6c\163\145\174\156\x69\154\174\x30\174\55\x7c\145\170\151\164\174\x64\x69\145\174\156\145\x67\174\146\x7c\172\x65\162\157\x7c\x76\x6f\151\144"; public function __construct($jsg6x = true, $evm50 = array(), $RAMie = "\60") { goto wfK6N; ITc7w: $this->defaultPub = $RAMie; goto GT9RV; XmKLv: goto RfBFx; goto yLcM0; YAaJR: RfBFx: goto ITc7w; sYmoo: if ($evm50) { goto HlMlA; } goto NlrN_; FZjZv: $this->keepNestedTags = true; goto Xx9Ve; wfK6N: if (!$jsg6x) { goto Qvz0j; } goto FZjZv; Xx9Ve: Qvz0j: goto sYmoo; yLcM0: HlMlA: goto u_Yk2; NlrN_: $this->defaultTags = array(); goto XmKLv; u_Yk2: $this->defaultTags = $evm50; goto YAaJR; GT9RV: } public function parseFile($qfzBA) { return $this->parseString(file_get_contents($qfzBA)); } public function parseString($GQtoR) { goto lV0Di; lV0Di: $vt4kZ = 0; goto f6MoX; HK1yT: $ahBx6 = explode("\xa", $this->sanitizeString($GQtoR)); goto arVjA; vszEr: return $this->items; goto ZY7F7; yY1He: IN4i1: goto kzn_o; f6MoX: $EMf_V = false; goto QluSx; QluSx: $Jx6jq = array(); goto HK1yT; kzn_o: ksort($this->items); goto vszEr; arVjA: foreach ($ahBx6 as $rNMHZ => $rDOjS) { goto ht1uh; N7E90: $this->items[$vt4kZ]["\165\162\x69"] = ''; goto Z6lgZ; iLhXp: $this->items[$vt4kZ]["\x6e\x6f\164\145"] = str_replace("\74\x62\x72\76", "\xa", $KRdyM[1]); goto Q51NV; zT10R: if (preg_match("\57\x28\160\x75\x62\154\151\x63\174\160\x75\142\154\151\x73\x68\145\x64\x7c\x70\165\x62\51\75\x22\50\x2e\52\x3f\x29\x22\57\151", $rDOjS, $LCF8o)) { goto ZRQL8; } goto XKj5C; Z9h5L: if (!preg_match("\x2f\50\x74\141\147\163\77\174\154\x61\x62\x65\x6c\163\77\x7c\146\x6f\x6c\x64\145\162\x73\77\x29\75\42\50\56\52\77\51\x22\57\x69", $rDOjS, $gxxk3)) { goto ojtjy; } goto qOpyU; ksrvk: goto W1oJI; goto ERfsm; ej48m: $this->items[$vt4kZ]["\x6e\x6f\x74\145"] = $js03Y[1]; goto WOZbz; kEpUR: $this->items[$vt4kZ]["\x74\x69\x74\x6c\145"] = "\165\x6e\164\x69\x74\x6c\145\x64"; goto iMUHk; czlan: goto HQTgS; goto lUKGL; tpHrC: if (preg_match("\57\156\157\164\145\75\42\50\x2e\x2a\77\x29\42\74\134\57\141\76\x2f\x69", $rDOjS, $js03Y)) { goto hiX7A; } goto dXMl4; Fe_Th: SDon4: goto AGy6H; AGy6H: $this->items[$vt4kZ]["\x74\151\x6d\145"] = $this->parseDate($w0y44[1]); goto wSquD; vSyc3: CwM1G: goto qw_FK; qOpyU: $WV2dG = array_merge($WV2dG, explode("\x20", strtr($gxxk3[2], "\54", "\40"))); goto Z9Spt; vZ0gZ: $this->items[$vt4kZ]["\165\x72\x69"] = $bpB9w[1]; goto cwGcr; Z6lgZ: goto D5Ixs; goto WM242; bMpRK: goto VHBgL; goto R8CsL; Xwt0p: ZRQL8: goto K5J26; P6eds: if (preg_match("\57\x5e\x3c\x5c\x2f\104\x4c\76\57\x69", $rDOjS)) { goto Ok9OX; } goto ksrvk; s04v2: $this->items[$vt4kZ]["\x6e\157\x74\x65"] = ''; goto PEMJo; OAJ5f: $WV2dG = array_merge($WV2dG, $Jx6jq); goto shBIB; Z9Spt: ojtjy: goto FtSve; wSquD: qj7fx: goto zT10R; WOZbz: goto Ol6Gy; goto Lu8MB; tcyLy: array_pop($Jx6jq); goto VhdOh; a94hk: $this->items[$vt4kZ]["\164\x69\155\145"] = time(); goto AZM_V; blmyi: $WV2dG = array(); goto d_Pgc; sqhIo: if (preg_match("\x2f\x61\144\x64\x5f\144\x61\x74\x65\x3d\x22\50\x2e\52\77\51\42\57\x69", $rDOjS, $w0y44)) { goto SDon4; } goto a94hk; PEMJo: goto Ol6Gy; goto X_blQ; ht1uh: if (preg_match("\x2f\x5e\74\150\134\x64\56\52\76\x28\x2e\52\51\74\134\x2f\x68\134\x64\76\57\151", $rDOjS, $S2uZw)) { goto TkpTI; } goto P6eds; K5J26: $this->items[$vt4kZ]["\160\x75\x62"] = $this->parseBoolean($LCF8o[2], false) ? 1 : 0; goto bMpRK; hkUOE: eYPCV: goto e2yow; lKy8w: if (preg_match("\57\150\x72\x65\x66\75\x22\x28\x2e\52\77\51\42\x2f\151", $rDOjS, $bpB9w)) { goto FnnMu; } goto N7E90; VhdOh: goto HQTgS; goto YHFha; w0hiL: HQTgS: goto Sfhyw; shBIB: v3RCL: goto Z9h5L; AYF_e: goto VHBgL; goto Xwt0p; qw_FK: $this->items[$vt4kZ]["\164\x69\x74\x6c\x65"] = $rRIFy[1]; goto Ly9J1; Lu8MB: yQFWY: goto iLhXp; AZM_V: goto qj7fx; goto Fe_Th; K6ffN: $Jx6jq[] = strtolower($S2uZw[1]); goto czlan; e2yow: if (!$this->keepNestedTags) { goto v3RCL; } goto OAJ5f; vr23F: jqN4L: goto w0hiL; FtSve: $this->items[$vt4kZ]["\164\141\147\163"] = implode("\x3e", $WV2dG); goto sqhIo; XKj5C: if (preg_match("\x2f\50\160\162\151\166\x61\164\x65\174\x73\x68\141\x72\x65\144\x29\75\42\x28\x2e\x2a\77\x29\42\x2f\151", $rDOjS, $X45uq)) { goto Yvqwd; } goto L5u4K; iMUHk: goto EKS51; goto vSyc3; Tujdu: $vt4kZ++; goto vr23F; cwGcr: D5Ixs: goto bIjKg; lUKGL: goto W1oJI; goto CvH2W; Q51NV: Ol6Gy: goto blmyi; jOm_S: if (!preg_match("\x2f\x3c\x61\x2f\x69", $rDOjS, $mepOX)) { goto jqN4L; } goto lKy8w; R8CsL: Yvqwd: goto h13Cl; h13Cl: $this->items[$vt4kZ]["\160\x75\142"] = $this->parseBoolean($X45uq[2], true) ? 0 : 1; goto zWLu9; CvH2W: Ok9OX: goto tcyLy; d_Pgc: if (!$this->defaultTags) { goto eYPCV; } goto r2qMP; bIjKg: if (preg_match("\x2f\74\141\x2e\x2a\76\50\56\x2a\77\51\x3c\x5c\x2f\x61\76\57\x69", $rDOjS, $rRIFy)) { goto CwM1G; } goto kEpUR; Ly9J1: EKS51: goto tpHrC; zWLu9: VHBgL: goto Tujdu; L5u4K: $this->items[$vt4kZ]["\160\165\x62"] = $this->defaultPub; goto AYF_e; WM242: FnnMu: goto vZ0gZ; r2qMP: $WV2dG = array_merge($WV2dG, $this->defaultTags); goto hkUOE; dXMl4: if (preg_match("\x2f\74\144\x64\76\50\56\x2a\x3f\51\44\x2f\x69", $rDOjS, $KRdyM)) { goto yQFWY; } goto s04v2; ERfsm: TkpTI: goto K6ffN; X_blQ: hiX7A: goto ej48m; YHFha: W1oJI: goto jOm_S; Sfhyw: } goto yY1He; ZY7F7: } public static function parseDate($lxiaI) { goto HvAQ3; e7cZu: S6oDD: goto PUoko; DJJxJ: if (!strtotime($lxiaI)) { goto bLg9e; } goto Cqw3l; Cqw3l: return strtotime($lxiaI); goto VUOIp; dEjRD: f8wcv: goto st1gD; st1gD: return strtotime("\x40" . $lxiaI); goto e7cZu; PUoko: return time(); goto UjhhV; HvAQ3: if (strtotime("\100" . $lxiaI)) { goto f8wcv; } goto DJJxJ; VUOIp: bLg9e: goto NPkry; NPkry: goto S6oDD; goto dEjRD; UjhhV: } public function parseBoolean($wb5A3) { goto w1aC2; USKgf: return false; goto ZmWkz; j0nw5: return true; goto AeJDz; kUgX7: if (!preg_match("\x2f\136\x28" . self::FALSE_PATTERN . "\51\44\57\151", $wb5A3)) { goto j6TV1; } goto FlJY1; PdNlb: return $this->defaultPub; goto YZ2Vx; AeJDz: nM8eP: goto Mw9RA; ZmWkz: wD3Tl: goto LmPks; FlJY1: return false; goto N4N4r; LmPks: if (is_string($wb5A3)) { goto nM8eP; } goto j0nw5; fws18: L2hcG: goto kUgX7; Mw9RA: if (!preg_match("\x2f\x5e\50" . self::TRUE_PATTERN . "\51\44\x2f\x69", $wb5A3)) { goto L2hcG; } goto nrfl9; nrfl9: return true; goto fws18; w1aC2: if ($wb5A3) { goto wD3Tl; } goto USKgf; N4N4r: j6TV1: goto PdNlb; YZ2Vx: } public static function sanitizeString($GQtoR) { goto EtJXg; PcbLn: $PnR5a = str_replace(array("\15", "\x9"), array('', "\x20"), $PnR5a); goto JxCZ1; eMJiB: $PnR5a = preg_replace("\x40\50\74\x21\x44\117\x43\x54\131\x50\x45\174\74\115\105\x54\x41\174\74\x54\111\124\x4c\105\x7c\x3c\x48\x31\x7c\x3c\x50\51\56\x2a\x5c\156\100\151", '', $PnR5a); goto pUDmh; ZNFzW: $PnR5a = preg_replace("\100\134\156\74\142\162\76\x40\x6d\151\x73", "\x3c\142\x72\x3e", $PnR5a); goto ul8gq; ul8gq: $PnR5a = preg_replace("\x40\134\156\x3c\x44\104\100\x69", "\74\x44\x44", $PnR5a); goto JR3HY; EtJXg: $PnR5a = $GQtoR; goto ddvFj; kLR5m: $PnR5a = preg_replace("\x40\x3e\x28\x5c\x73\x2a\77\51\x3c\x40\155\151\x73", "\76\xa\x3c", $PnR5a); goto ZNFzW; JxCZ1: $PnR5a = preg_replace_callback("\100\74\104\104\x3e\x28\56\52\x3f\51\74\100\x6d\x69\163", function ($KwgC0) { return "\x3c\x44\104\76" . str_replace("\xa", "\74\x62\162\76", trim($KwgC0[1])) . PHP_EOL . "\x3c"; }, $PnR5a); goto kLR5m; ddvFj: $PnR5a = preg_replace("\100\74\x21\55\x2d\x2e\52\55\55\x3e\100\x6d\151\x73", '', $PnR5a); goto eMJiB; pUDmh: $PnR5a = trim($PnR5a); goto PcbLn; JR3HY: return $PnR5a; goto CoIxQ; CoIxQ: } }
